package com.shensi.api.admin.client.customer;

import com.shensi.api.admin.client.fallback.customer.CustomerGradeSettingClientFallBack;
import com.shensi.api.admin.domian.customer.dto.CustomerGradeSettingDto;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author: budian
 * @since: 2023/11/30
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = CustomerGradeSettingClientFallBack.class)
@Component
public interface CustomerGradeSettingClient {


    /**
     * 查询客户优惠等级设置列表
     */
    @GetMapping("/customer/setting/list")
    public TableDataInfo list(@SpringQueryMap CustomerGradeSettingDto customerGradeSetting);



    /**
     * 查询当前登录人员的等级
     */
    @GetMapping("/customer/setting/listByLogin")
    public TableDataInfo listByLogin();

    /**
     * 导出客户优惠等级设置列表
     */
    @GetMapping("/customer/setting/export")
    public AjaxResult export(@SpringQueryMap CustomerGradeSettingDto customerGradeSetting);

    /**
     * 获取客户优惠等级设置详细信息
     */
    @GetMapping(value = "/customer/setting/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id);

    /**
     * 新增客户优惠等级设置
     */
    @PostMapping
    public AjaxResult add(@RequestBody CustomerGradeSettingDto customerGradeSetting);

    /**
     * 修改客户优惠等级设置
     */
    @PutMapping
    public AjaxResult edit(@RequestBody CustomerGradeSettingDto customerGradeSetting);

    /**
     * 删除客户优惠等级设置
     */
    @DeleteMapping("/customer/setting/{ids}")
    public AjaxResult remove(@PathVariable("ids") Long ids);

    /**
     * 查询等级名称
     */
    @GetMapping("/customer/setting/gradeList")
    public TableDataInfo gradeList(@SpringQueryMap CustomerGradeSettingDto customerGradeSetting);
}
